#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 110;
int a[N];
int n;
#define int long long
bool judge(int x)
{
	if (x == 0)
		return true;
	int l = 0;
	for (int i = n;  i > l; i--)
	{
		if (a[i] <= x)
		{
			l ++;
			x--;
		}
		if (x == 0) return true;
	}
	return false;
}
void solve()
{
	cin >> n;

	for (int i = 1; i <= n; i++)
		cin >> a[i];
	sort(a, a + n + 1);
	int l = 0, r = n % 2 ? n / 2 + 1 : n / 2;
	//cout << l << '_' << r << endl;
	while (l < r)
	{
		int m = (l + r) >> 1;
		cout << m << '|' << l << '|' << r << endl;

		if (judge(m))
		{
			l = m + 1;
			//cout << "l" << endl;
		}
		else r = m;
	}
	cout << l << endl;
}
signed main()
{
	int t = 1;
	cin >> t;
	while (t--)
		solve();
	return 0;
}